/***
    Amrita ITEWS - Copyright (C) 2009 Amrita Vishwa Vidyapeetham, Amritapuri.
                                       (http://www.amrita.edu)
    ***************************************************************************
    This file is part of the Amrita ITEWS distribution.
    Amrita ITEWS is free software; you can redistribute it and/or modify it
    under the terms of the GNU General Public License (version 2) as published
    by the Free Software Foundation AND MODIFIED BY the Amrita ITEWS exception.
    ***NOTE*** The exception to the GPL is included to allow you to distribute
    a combined work that includes Amrita ITEWS without being obliged to provide
    the source code for proprietary components outside of the Amrita ITEWS
    software. Amrita ITEWS is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General
    Public License for more details. You should have received a copy of the GNU
    General Public License and the Amrita ITEWS license exception along with
    Amrita ITEWS if not then it can be viewed here:
    http://itews.amrita.ac.in/license.html.


    Documentation, latest information, license and contact details are at:
    http://itews.amrita.ac.in/


    Amrita ITEWS source code can be found at:
    http://code.google.com/p/itews


    The initial code-base of Amrita ITEWS was developed by Amrita Vishwa
    Vidyapeetham as part of the project titled,"Intelligent & Interactive
    Telematics using Emerging Wireless Technologies for Transport Systems
    (ITEWS)" sponsored by Technology Information Forecasting and Assessment
    Council (TIFAC), India.
***/

/*! \file power_eventq.h
    \brief Power Eventq SPI Header file.
*/

#ifndef POWER_EVENTQ_H_
#define POWER_EVENTQ_H_

#include <eventq.h>
#include <errno.h>
#include <log_api.h>

/*! \brief Ignition off status. */
#define IGNITION_OFF    0x00

/*! \brief Ignition on status. */
#define IGNITION_ON     0x01

/*! \brief Power low buzzer off status. */
#define POWER_LOW_BUZZER_OFF    0x00

/*! \brief Power low buzzer on status. */
#define POWER_LOW_BUZZER_ON     0x01

/*! \brief Event for getting power ignition status,
param (o):- returns the ignition status (POWER_IGNITION_OFF or POWER_IGNITION_ON),
buf : none.
*/
#define EVT_POWER_GET_IGNITION_STATUS 0x00

/*! \brief Event for getting battery status.
 param(o):- returns a uint32 number indicating battery voltage.
 */
#define EVT_POWER_GET_BATTERY_STATUS  0x01

/*! \brief Event for putting powerlow buzzer on status.
 */
#define EVT_PUT_POWER_LOW_BUFFER_ON   0x02

/*! \brief Event for putting powerlow buzzer off status.
 */
#define EVT_PUT_POWER_LOW_BUFFER_OFF  0x03

extern eventq_ops_t power_eventq_ops;

/*SPI*/
STATUS power_eventq_open        ( eventq_ctx_t *e_ctx, const char *eventq_name );
STATUS power_eventq_close       ( eventq_ctx_t *e_ctx );
STATUS power_eventq_sync_put    ( eventq_ctx_t *e_ctx, event_t *e, HRESULT *res );
STATUS power_eventq_sync_get    ( eventq_ctx_t *e_ctx, event_t *e );

#endif /*POWER_EVENTQ_H_*/
